package br.com.minhascontas.activity;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import br.com.example.minhascontas.R;
import br.com.minhascontas.DAO.MinhasContasOpenHelper;
import br.com.minhascontas.activity.ajuda.Ajuda;
import br.com.minhascontas.activity.grupo.MenuCadastroGrupo;
import br.com.minhascontas.activity.lancamento.NovoLancamento;
import br.com.minhascontas.activity.relatorio.MenuRelatorio;

public class Menu extends Activity{
	
	private Button btnNovaDespesa; 
	private Button btnRelatorios;
	private Button btnAjuda;
	private Button btnCadastroGrupo;

	
	private MinhasContasOpenHelper dataSource = new MinhasContasOpenHelper(this);
	
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.menu);
		
		dataSource.open(); // cria tabelas
		
		btnNovaDespesa = (Button) findViewById(R.id.btnNovaDespesa);
		btnRelatorios = (Button) findViewById(R.id.btnRelatorios);
		btnAjuda = (Button) findViewById(R.id.btnAjuda);
		btnCadastroGrupo = (Button) findViewById(R.id.btnCadastroGrupo);
		
		btnNovaDespesa.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(Menu.this, NovoLancamento.class);
				startActivity(intent);
			}
		});
		
		btnRelatorios.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(Menu.this, MenuRelatorio.class);
				startActivity(intent);
			}
		});

		btnAjuda.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(Menu.this, Ajuda.class);
				startActivity(intent);
			}
		});
		
		btnCadastroGrupo.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(Menu.this, MenuCadastroGrupo.class);
				startActivity(intent);
			}
		});
	}
	
}
